package com.snj.bestdealer.lib;

import android.content.Context;
import android.util.Log;
import android.view.Gravity;
import android.widget.Toast;

public class SimpleToast {
	final static String TAG = "SimpleToast";
	public static void show(Context context, String message) {
		try {
			Toast toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
			toast.setGravity(Gravity.CENTER, 0, 0);
			toast.show();
		}
		catch(NullPointerException e) {
			Log.d(TAG, e.getMessage());
		}
	}
	
	public static void show(Context context, String message, int duration)
	{
		try {
			Toast toast = Toast.makeText(context, message, duration);
			toast.setGravity(Gravity.CENTER, 0, 0);
			toast.show();
		}
		catch(NullPointerException e) {
			Log.d(TAG, e.getMessage());
		}
	}
	
	public static void show(Context context, String message, int gravity, int duration)
	{
		try {
			Toast toast = Toast.makeText(context, message, duration);
			toast.setGravity(gravity, 0, 0);
			toast.show();
		}
		catch(NullPointerException e) {
			Log.d(TAG, e.getMessage());
		}
	}
}
